<template>
  <div>
      <van-field label="小说名称" v-model="name"/>
      <van-button @click="submit">提交</van-button>
  </div>
</template>

<script>
import axios from '../../http/axios'
export default {
data () {
    return {
        name:'',
        userid:localStorage.getItem('userid')
    }
},
methods: {
    submit(){
        axios('/novel','post',{'name':this.name,'userid':this.userid}).then(res=>{
            console.log(res)
            if(res.code==200){
                this.name=''
            }
        })
    }
},
mounted () {
    
}
}
</script>

<style>

</style>